package com.application.mylibrary.config;

import android.os.Environment;

/**
 * Created by hemeng on 2017/11/8.
 */

public class Common {

    public static int EMOTICON_CLICK_TEXT = 1;
    public static int EMOTICON_CLICK_BIGIMAGE = 2;


    public static int ONE_PAGE_COUNT = 20;//分页加载默认数量


    public static class Match {
        public static final long MATCH_TIME_OUT = 15 * 1000;
    }

    public static class PushJumpType {
        public static final int JUMP_IM = 1;//跳转IM
        public static final int JUMP_VIDEO = 2;//跳转视频房间
        public static final int JUMP_AUDIO = 3;//跳转语音房间
        public static final int JUMP_ZHANNEIXIN = 4;//跳转站内信
        public static final int JUMP_ADD_FRIEND = 5;//跳转申请列表
        public static final int JUMP_VIDEO_LIST = 6;//跳转视频列表
        public static final int JUMP_HOME = 9;//deeplink跳转到首页
        public static final int JUMP_GROUP_CHAT = 8;//跳转群组聊天界面
        public static final int JUMP_USER_CENTER = 10;//跳转用户详情界面
        public static final int JUMP_GROUP_CENTER = 11;//群组详情页面
        public static final int JUMP_SYSTAM_IMAMIN = 12;//站内信
    }


    /**
     * 消息状态
     */
    public static class MsgStates {
        public static final int MSG_SEND_SUCCESS = -1;
        public static final int MSG_SEND_FAILD = -2;
        public static final int MSG_SEND_SENDING = -3;
    }

    public static class HandlerWhat {

        public static final int WHAT_LEAVE_ROOM = 1001;
        public static final int WHAT_STREAMING_SUCCESS = 1002;
        public static final int WHAT_USER_AUDIO_VOLUME = 1003;
        public static final int WHAT_USER_AUDIO_Reconnect_later = 1004;//延迟重连
        public static final int WHAT_USER_AUDIO_Reconnect = 1005;//立刻重连
        public static final int IS_ADD_FOLLOW_MESSAGE = 1006;
        public static final int IS_reConnectRunnable = 1007;//断线重连
        public static final int IS_reConnectLoadOnMiC = 1008;//重新加载麦位还有歌手信息
        public static final int SET_USER_ONMIC_HEAD_ANIM = 1010;//设置麦上的人送礼动画
        public static final int IS_ADD_GROUP_MESSAGE = 1009; // 是否添加 加入组消息

    }

    /**
     * 每个房间的最大人数限制
     */
    public static class RoomMaxUser {
        public static final int MAX_AUDIO = 8;
        public static final int MAX_TEXT = 10;
        public static final int MAX_VIDEO = 6;
    }

    /**
     * 被踢原因
     */
    public static class KickType {
        public static final int OTHER_LOGIN = 1;
        public static final int USER_BAN = 2;
    }


    /**
     * 连麦状态
     */
    public static class MicStates {
        public static final int ONLINE = 0;//上麦
        public static final int OFFLINE = 1;//下麦
    }

    //房间type
    public static class RoomType {
        //显示区域 1 文字 2 语音 3 视频 4 游戏 5 好友 0正常状态
        public static final int TYPE_TEXT = 9;
        public static final int TYPE_VIDEO = 1;
        public static final int TYPE_AUDIO = 2;
        public static final int TYPE_GAME = 4;
        public static final int TYPE_CHAT_IM = 5;
        public static final int TYPE_INVITE_PET = 6;
        public static final int TYPE_NONE = 0;
        public static final int TYPE_CHAT_GAME = 10;//游戏临时聊天室
        public static final int TYPE_GROUP = 7;// 群组
        public static final int TYPE_FANS = 8;// 粉丝
        public static final int TYPE_INVITE_GROUP_USER = 11;
    }

//    /**
//     * 全局 房间类型
//     * 服务器定义
//     */
//    public static class Room {
//        /**
//         * 视频
//         */
//        public static final byte VIDEO = 1;
//        /**
//         * 语音
//         */
//        public static final byte AUDIO = 2;
//
//        /**
//         * 游戏
//         */
//        public static final byte GAME = 4;
//    }


    public static class RoomParams {
        public static final String GROUP_ID = "group_id";
        public static final String GROUP_TYPE = "group_type";
    }

    public static class CustomMsgType {
        public static final String TEXT = "text";
        public static final String GIF = "gif";
        public static final String DANMU = "danmu";
        public static final String PICTURE = "pic";
        public static final String MEDIA = "media";
        public static final String HTML = "html";
    }

    public static class LoginType {
        public static final int FACEB00K = 11;
        public static final int GOOGLE = 12;
        public static final int PHONE = 13;

    }

    public static class CountryShortName {
        public static final String CHINA = "CN"; // 中国
        public static final String INDIA = "IN"; // 印度
    }

    public static class Language {
        public static final int CHINESE = 100; // 中文
        public static final int ENGLISH = 200; // 英语
        public static final int HINGLISH = 201; // 印度英语
        public static final int HINDI = 301; // 印地语
        public static final int TELUGU = 302; // 泰卢固语
        public static final int BENGALI = 303; // 孟加拉语
        public static final int TAMIL = 304; // 泰米尔语
        public static final int ARABIC = 400; // 阿拉伯语
    }

    public static class LangShortName {
        public static final String CHINESE = "zh"; // 中文
        public static final String ENGLISH = "en"; // 英语
        public static final String HINGLISH = "en-rIN"; // 印度英语
        public static final String HINDI = "hi"; // 印地语
        public static final String TELUGU = "te"; // 泰卢固语
        public static final String BENGALI = "bn"; // 孟加拉语
        public static final String TAMIL = "ta"; // 泰米尔语
        public static final String ARABIC = "ar"; // 阿拉伯语

    }

    public static class UserAttr {
        public static final String NickName = "1";
        public static final String Birthday = "4";
        public static final String LOCATION = "5";
        public static final String IndroDesc = "6";
        public static final String Hometown = "7";
        public static final String Presentaddr = "8";
        public static final String Professional = "9";//2.1新增 职业
        public static final String SCHOOL = "10";
        public static final String AUDIO_INTRODUCE_URL = "12";
        public static final String Language = "14";
        public static final String Objective = "15";
        public static final String Relationshap = "16";
        public static final String Religion = "17";
        public static final String Weight = "23";//2.1新增 体重
        public static final String Height = "24";//2.1新增 身高
        public static final String Diet = "25";//2.1新增 饮食习惯 逗号分割 例如 1,2,3
        public static final String Tag = "26";// 2.10.0 用户tag标签
        public static final String ISFIRSTREGISTER = "first_register";
        public static final String DISCOUVERGUIDE = "discover_guide";
        public static final String MEGUIDE = "me_guide";

        public static final String ISFIRSTENTERKTV = "first_enter_ktv_room";

        public static final String ISCHESTAVAILABLE = "chestAvailable";
    }

    public static class AddFriendFrom {

        public static final int FROM_AUDIO = RoomType.TYPE_AUDIO;
        public static final int FROM_VIDEO = RoomType.TYPE_VIDEO;
        public static final int FROM_TEXT = RoomType.TYPE_TEXT;
        public static final int FROM_GAME = RoomType.TYPE_GAME;
        public static final int FROM_SEARCH = -1;
        public static final int FROM_ADD = -2;
        public static final int FROM_FANS = RoomType.TYPE_FANS;
    }

    //道具类型
    public static class PropType {

        public static final int NORMAL = 1;
        public static final int FLOWER = 2;
        public static final int EGG = 3;
        public static final int SUGAR = 4;
    }

    public static class SpecialPropId {
        public static final int SUGAR_ID = 1000;
    }

    public static class BottomPanelType {
        public static final int GIFT = 1;
        public static final int LUCKY = 2;
    }

    //用户性别
    public static class UserSex {
        public static final int USER_SEX_MALE = 1;
        public static final int USER_SEX_FEMALE = 2;
    }

    //静态资源key
    public static class ResourceKey {
        //        "object_active": "目的页版本号",
        //        "startup_page": "启动页版本号",
        //        "game_image": "游戏入口图片版本号",
        //        "banner": "banner版本号",
        //        "game": "游戏版本号",
        //        "app": "app更新配置版本号",
        //        "gobal": "全局配置版本号",
        //        "level": "等级版本号",
        //        "task": "任务版本号",
        //        "shop": "商城版本号",
        //        "gift": "礼物版本号",
        //        "report": "上报版本号",
        //        "face": "表情版本号"
        //        "audio_label": "音频标签"
        public static final String KEY_ACTIVE = "object_active";
        public static final String KEY_STARTUP = "startup_page";
        public static final String KEY_BANNER = "banner";
        public static final String KEY_GAME = "game";
        public static final String KEY_APP_VERSION = "app";
        public static final String KEY_GLOBAL = "gobal";
        public static final String KEY_LEVEL = "level";
        public static final String KEY_GIFT = "gift";
        public static final String KEY_AUDIO_LABEL = "audio_label";
        public static final String KEY_AUDIO_business_LABEL = "audio_business_label";
        public static final String KEY_AUDIO_COUNTRY = "audio_country";
        public static final String KEY_DISCOVER_TIP = "tip";
        public static final String KEY_DISCOVER_VIDEO = "video_open_time";
        public static final String KEY_VOICE_ROOM_TIP = "audio_create_code_desc";
        public static final String KEY_SIGN_DATA = "sign";
        public static final String KEY_APP_DATA = "app";
        public static final String KEY_TASK_DATA = "task";
        public static final String KEY_WAKEUP_TIME = "global";
    }


    public static class UserCommonExtraKey {
        /**
         * "balance": "用户钱",
         * "user": "用户基本信息",
         * "gift": "用户背包礼物列表",
         * "flower": "用户鲜花个数",
         * "pic": "用户图片",
         * "statistics": "统计信息",
         * "egg": "鸡蛋",
         * "group": "房间信息"
         */
        public static final String KEY_BALANCE = "balance";
        public static final String GOLD1 = "gold1";
        public static final String GOLD2 = "gold2";
        public static final String GOLD3 = "gold3";
        public static final String GOLD4 = "gold4";
        public static final String SUGAR = "user_sugar"; // 2019.04.13 2.8.0 糖果
        public static final String KEY_USER = "user";
        public static final String KEY_GIFT = "gift";
        //        public static final String KEY_FLOWER = "flower";
        public static final String KEY_PIC = "pic";
        public static final String KEY_STATISTICS = "statistics";
        //        public static final String KEY_EGG = "egg";
        public static final String KEY_USER_GROUPS = "user_groups";
        public static final String KEY_LIKE_USER_NUM = "like_user_num"; // 粉丝数 喜歡用戶的數目
        public static final String KEY_USER_LIKE_NUM = "user_like_num"; // 关注数 用戶喜歡的數目
        public static final String KEY_GUEST_NUM = "guest_num";
        public static final String KEY_USER_TAG = "userTag";
    }

    public static class SharedPrefDbName {
        public static final String FIRST_RECORD = "first_record";
        public static final String GUIDE_RECORD = "guide_record";
        public static final String LANGUAGE_RECORD = "lang_record";
    }

    public static class FirstRecordKey {
        public static final String FIRST_SEND_GIFT = "first_send_gift";
        public static final String FIRST_PLAY_DICE = "first_play_dice";
        public static final String FIRST_PLAY_DICE_COST_DIAMOND = "first_play_dice_cost_diamond"; // 2.1.0 掷骰子花费1金币改为1钻石
        public static final String FIRST_SEND_FM_DANMU_COST_DIAMOND = "first_send_fm_danmu_cost_diamond"; // 2.1.0 发弹幕花费1金币改为1钻石
        public static final String TEXT_ROOM_SEND_MESSAGE = "guide_text_room_send_message";
        public static final String AUDIO_ROOM_TAKE_MIC = "guide_audio_room_take_mic";
        public static final String AUDIO_ROOM_BREAK_BUBBLE = "guide_audio_room_break_bubble";
        public static final String ENTER_VIDEO_ROOM = "guide_enter_video_room";
        public static final String USER_CARD_SEND_FLOWER = "guide_user_card_send_flower";
        public static final String LANGUAGE_RECORD_KEY = "lang_record_key";
        //是否设置过语言
        public static final String KEY_IS_FIRST_SET_LANGUAGE = "key_is_first_set_language";

    }


    public static class ErrorCode {
        //代表 http 请求失败了
        public static final int HTTP_REQUEST_FAILED = -9999;
        //服務器停服更新
        public static final int SERVET_UP = -1;
        //代表 http 成功 并且 code == 0
        public static final int LOGIC_SUCCESS = 0;
        public static final int LOGIN_LOGINKEY_UNAVAILABLE = 99;
        // ip 被禁用
        public static final int LOGIC_IP_BANED = 405;
        // 设备被禁用
        public static final int LOGIC_DEVICE_BANED = 403;

        public static final int LOGIN_UPDATA = 600;

        public static final int LUCKY_HAS_DONE = 19000001;
        public static final int LUCKY_USER_HAS_GET = 19000002;
        public static final int LUCKY_MAX_BALANCE = 19000003;
        public static final int LUCKY_MAX_DAY_BANLANCE = 19000004;
        public static final int LUCKY_MAX_DAY_COUNT = 19000005;
        public static final int LUCKY_ROOM_NOT_EXSIT = 19000006;
        public static final int LUCKY_USER_NOT_CURRENT_ROOM = 19000007;
        public static final int LUCKY_NOT_EXSIT = 19000008;
        public static final int LUCKY_PARAMS_NOT_ALLOW = 19000009;


        public static final int USER_SERVER_ERROR = 2000001;//用户系统错误
        public static final int USER_NOT_EXIST = 2000004;//用户不存在

        public static final int GROUP_NOT_EXIST = 20000001;//组不存在
        public static final int GROUP_MAX_NUM = 20000004;//组满

        public static final int MIC_ALREADY_CONNECTED = 2000000011;//已经在麦上
        public static final int AUDIO_PROP_NOT_IN_TIME = 22000003;//不到抢道具的时间
        public static final int AUDIO_USER_ISMUTE = 27000007;//禁言
        public static final int AUDIO_HOST_ISMUTE = 27000011;//禁言
        public static final int AUDIO_USER_NOT_SPKER = 26000011;//禁麦
        public static final int AUDIO_NOT_IM_ROOM = 27000008;//不在房间中
        public static final int AUDIO_ADMIN_FULL = 27000017;// 管理员人数达到上限

        public static final int IM_BANED = 29000003; // IM被禁言
        public static final int FRIEND_APPLY_LIMIT_COMPLATE_INFO = 29000004;// 打招呼/加好友达到上限，补全信息
        public static final int FRIEND_APPLY_LIMIT = 29000005;// 打招呼/加好友达到上限
        public static final int FRIEND_APPLY_WITHDRAW = 29000008;// 打招呼/对方撤回打招呼


        // 发送文本消息触发敏感词 ，客户端不用过滤 ，按照 成功 处理
        public static final int TEXT_INPUT_MIGANCI = 12000006;
        // 个人介绍中包含敏感词
        public static final int PROFILE_MINGANCI = 2000018;
        //昵称包含关键字
        public static final int PROFILE_NICK_FUCK = 2000009;
        //昵称长度不对
        public static final int PROFILE_NICK_LENGTH = 2000008;
        //到达分享最大次数
        public static final int SHARE_MAX_COUNT = 13000004;
        // 用户在黑名单中
        public static final int IN_BLACK_LIST = 12000011;
        public static final int LOGIC_DEVICE_BANED2 = 2000016;//登录禁止错误
    }


    public static class Share {

        public static final String shareBaidu = "https://app.appsflyer.com/com.ganesha.pie?pid=appshare&c=1.0";

    }


    public static class WebviewCallBack {
        //webview jscallback name
//        public static final String name = "Fission";
        public static final String name = "Pie";
    }


    public static class PicResize {

        public static final int SIZE_100 = 144;
        public static final int SIZE_500 = 500;

    }


    public static final String NavVersion = "NavVersion";


    public static final String MEDIA_SDK_LOG_PATH = "pie_mic";

    public static class Dir {
        public static final String EXTRA_STORAGE = Environment.getExternalStorageDirectory().getAbsolutePath();
        public static final String BASE_DIR = EXTRA_STORAGE + "/pie";

        public static final String SONG_DIR = BASE_DIR + "/pie_song";

    }

    public static class IntentAction {
        public static final int INTENT_ACTION_GROUP_CENTER = 10100;
        public static final int INTENT_ACTION_GROUP_CENTER_EXIT = 10101;

        public static final int INTENT_ACTION_GROUP_MESSAGE = 10200;

        public static final int INTENT_ACTION_GROUP_LIST = 10300;

        public static final int INTENT_ACTION_USER_TAG_SEL = 10400;

        public static final int INTENT_ACTION_USER_PROFILE = 10500;

    }

    public static interface MessageState {
        int SENDING = 1;//正在发送
        int SENDED = 2;//发送成功
        int FAILD = 3;//发送失败
    }
}
